import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/home/enterprise/enterprise_emergency_plan_entity_entity.dart';

EnterpriseEmergencyPlanEntityEntity $EnterpriseEmergencyPlanEntityEntityFromJson(Map<String, dynamic> json) {
  final EnterpriseEmergencyPlanEntityEntity enterpriseEmergencyPlanEntityEntity = EnterpriseEmergencyPlanEntityEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    enterpriseEmergencyPlanEntityEntity.id = id;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    enterpriseEmergencyPlanEntityEntity.createTime = createTime;
  }
  final int? companyId = jsonConvert.convert<int>(json['companyId']);
  if (companyId != null) {
    enterpriseEmergencyPlanEntityEntity.companyId = companyId;
  }
  final String? planName = jsonConvert.convert<String>(json['planName']);
  if (planName != null) {
    enterpriseEmergencyPlanEntityEntity.planName = planName;
  }
  final String? planCode = jsonConvert.convert<String>(json['planCode']);
  if (planCode != null) {
    enterpriseEmergencyPlanEntityEntity.planCode = planCode;
  }
  final String? planCompany = jsonConvert.convert<String>(json['planCompany']);
  if (planCompany != null) {
    enterpriseEmergencyPlanEntityEntity.planCompany = planCompany;
  }
  final String? planPerson = jsonConvert.convert<String>(json['planPerson']);
  if (planPerson != null) {
    enterpriseEmergencyPlanEntityEntity.planPerson = planPerson;
  }
  final int? planTypeId = jsonConvert.convert<int>(json['planTypeId']);
  if (planTypeId != null) {
    enterpriseEmergencyPlanEntityEntity.planTypeId = planTypeId;
  }
  final String? planTypeName = jsonConvert.convert<String>(json['planTypeName']);
  if (planTypeName != null) {
    enterpriseEmergencyPlanEntityEntity.planTypeName = planTypeName;
  }
  final int? reasonTypeId = jsonConvert.convert<int>(json['reasonTypeId']);
  if (reasonTypeId != null) {
    enterpriseEmergencyPlanEntityEntity.reasonTypeId = reasonTypeId;
  }
  final String? reasonTypeName = jsonConvert.convert<String>(json['reasonTypeName']);
  if (reasonTypeName != null) {
    enterpriseEmergencyPlanEntityEntity.reasonTypeName = reasonTypeName;
  }
  final String? planTime = jsonConvert.convert<String>(json['planTime']);
  if (planTime != null) {
    enterpriseEmergencyPlanEntityEntity.planTime = planTime;
  }
  final int? levelId = jsonConvert.convert<int>(json['levelId']);
  if (levelId != null) {
    enterpriseEmergencyPlanEntityEntity.levelId = levelId;
  }
  final String? levelName = jsonConvert.convert<String>(json['levelName']);
  if (levelName != null) {
    enterpriseEmergencyPlanEntityEntity.levelName = levelName;
  }
  final String? fileUrl = jsonConvert.convert<String>(json['fileUrl']);
  if (fileUrl != null) {
    enterpriseEmergencyPlanEntityEntity.fileUrl = fileUrl;
  }
  final String? planType = jsonConvert.convert<String>(json['planType']);
  if (planType != null) {
    enterpriseEmergencyPlanEntityEntity.planType = planType;
  }
  return enterpriseEmergencyPlanEntityEntity;
}

Map<String, dynamic> $EnterpriseEmergencyPlanEntityEntityToJson(EnterpriseEmergencyPlanEntityEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['createTime'] = entity.createTime;
  data['companyId'] = entity.companyId;
  data['planName'] = entity.planName;
  data['planCode'] = entity.planCode;
  data['planCompany'] = entity.planCompany;
  data['planPerson'] = entity.planPerson;
  data['planTypeId'] = entity.planTypeId;
  data['planTypeName'] = entity.planTypeName;
  data['reasonTypeId'] = entity.reasonTypeId;
  data['reasonTypeName'] = entity.reasonTypeName;
  data['planTime'] = entity.planTime;
  data['levelId'] = entity.levelId;
  data['levelName'] = entity.levelName;
  data['fileUrl'] = entity.fileUrl;
  data['planType'] = entity.planType;
  return data;
}

extension EnterpriseEmergencyPlanEntityEntityExtension on EnterpriseEmergencyPlanEntityEntity {
  EnterpriseEmergencyPlanEntityEntity copyWith({
    int? id,
    String? createTime,
    int? companyId,
    String? planName,
    String? planCode,
    String? planCompany,
    String? planPerson,
    int? planTypeId,
    String? planTypeName,
    int? reasonTypeId,
    String? reasonTypeName,
    String? planTime,
    int? levelId,
    String? levelName,
    String? fileUrl,
    String? planType,
  }) {
    return EnterpriseEmergencyPlanEntityEntity()
      ..id = id ?? this.id
      ..createTime = createTime ?? this.createTime
      ..companyId = companyId ?? this.companyId
      ..planName = planName ?? this.planName
      ..planCode = planCode ?? this.planCode
      ..planCompany = planCompany ?? this.planCompany
      ..planPerson = planPerson ?? this.planPerson
      ..planTypeId = planTypeId ?? this.planTypeId
      ..planTypeName = planTypeName ?? this.planTypeName
      ..reasonTypeId = reasonTypeId ?? this.reasonTypeId
      ..reasonTypeName = reasonTypeName ?? this.reasonTypeName
      ..planTime = planTime ?? this.planTime
      ..levelId = levelId ?? this.levelId
      ..levelName = levelName ?? this.levelName
      ..fileUrl = fileUrl ?? this.fileUrl
      ..planType = planType ?? this.planType;
  }
}